package cn.tedu.douguo.user.mapper;

import cn.tedu.douguo.user.pojo.entity.Recipe;
import cn.tedu.douguo.user.pojo.entity.RecipeStep;
import cn.tedu.douguo.user.pojo.vo.RecipeDetailsVO;
import cn.tedu.douguo.user.pojo.vo.RecipeIngredientsVO;
import cn.tedu.douguo.user.pojo.vo.RecipeListVO;
import cn.tedu.douguo.user.pojo.vo.RecipeStepVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author Administrator
* @description 针对表【cms_recipe(菜谱表)】的数据库操作Mapper
* @createDate 2023-06-18 16:25:22
* @Entity generator.domain.Recipe
*/
@Repository
public interface RecipeMapper extends BaseMapper<Recipe> {


    //插入一个菜谱数据
    int insert(Recipe recipe);

    //获取菜谱的精选
    List<RecipeListVO> listBySort();

//    获取单个菜谱的食材
    RecipeIngredientsVO getIngredientByRecipeId(Long recipeId);

//    获取单个菜谱的步骤
    RecipeStepVO getStepByRecipeId(Long recipeId);

//    单个菜谱
    RecipeDetailsVO getDetailsByRecipeId(Long recipeId);

    //获取所有菜谱

    List<RecipeListVO> listAll();

    List<RecipeListVO> listByKeyword(String keyword);



}
